# Contributor: Natanael Copa <ncopa@alpinelinux.org>
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=perl-test-nowarnings
pkgver=1.04
pkgrel=2
pkgdesc="Test::NoWarnings perl module"
url="https://metacpan.org/release/Test-NoWarnings/"
arch="noarch"
license="GPL-2.0 or Artistic"
depends="perl perl-test-simple"
makedepends="perl-dev"
install=""
subpackages="$pkgname-doc"
source="https://cpan.metacpan.org/authors/id/A/AD/ADAMK/Test-NoWarnings-$pkgver.tar.gz"

_builddir="$srcdir"/Test-NoWarnings-$pkgver
prepare() {
	local i
	cd "$_builddir"
	for i in $source; do
		case $i in
		*.patch) msg $i; patch -p1 -i "$srcdir"/$i || return 1;;
		esac
	done
}

build() {
	cd "$_builddir"
	PERL_MM_USE_DEFAULT=1 perl Makefile.PL INSTALLDIRS=vendor || return 1
	make && make test || return 1
}

package() {
	cd "$_builddir"
	make DESTDIR="$pkgdir" install || return 1
	find "$pkgdir" \( -name perllocal.pod -o -name .packlist \) -delete
}

sha512sums="48126d2385e6f7863067f541763f64bc72132f6093f316f75d15ad7dca9b863dc469dff18c6e3f93105647844acb5cd10e4d056d3aa19217cb9588eb8a5f0d7a  Test-NoWarnings-1.04.tar.gz"
